<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset="utf-8">
<title>模拟配置管理 |模拟新增配置管理</title>
<@fm.header />
<style>
.provinceClass label {
	font-size: 12px;
	float:left;
	margin:2px;
	width:80px;
	height:20px;
}
 table
{
    border-collapse: collapse;
    margin: 0 auto;
    text-align: center;
}
table td, table th
{
    border: 1px solid #cad9ea;
    color: #666;
    height: 30px;
}
table thead th
{
    background-color: #CCE8EB;
    width: 100px;
}
table tr:nth-child(odd)
{
    background: #fff;
}
table tr:nth-child(even)
{
    background: #F5FAFA;
}
</style>
</head>
<body>
<div class="easyui-layout" style="text-align: center; height: 270px;" fit="true">
	<div region="center" border="false" style="padding: 10px; background: #fff; border: 1px solid #ccc;">
	<table width="90%" class="table">
    <caption>
         <h2>关键字查询</h2>
    </caption>
    <thead>
        <tr>
            <th>关键字</th>
            <th>说明</th>
        </tr>
    </thead>
    <tbody>
    <tr>
        <td>channelName</td>
        <td>渠道名称</td>
    </tr>
    <tr>
        <td>apkName</td>
        <td>apk名称</td>
    </tr>
    <tr>
        <td>registerActivity</td>
        <td>registerActivity</td>
    </tr>
    <tr>
        <td>fileFilter</td>
        <td>文件过滤</td>
    </tr>
    <tr>
        <td>base</td>
        <td>基地</td>
    </tr>
    <tr>
        <td>carrier</td>
        <td>短信接口(  1、联通 2 移动 3 电信)</td>
    </tr>
     <tr>
        <td>smsId</td>
        <td>运营商</td>
    </tr>
     <tr>
        <td>isFill</td>
        <td>是否补量包</td>
    </tr>
    <tr>
        <td>isBrush</td>
        <td>是否拉活包</td>
    </tr>
      <tr>
        <td>retent24Filter</td>
        <td>留存顺序执行</td>
    </tr>
      <tr>
        <td>andriodVer</td>
        <td>指定安卓版本</td>
    </tr>
    <tr>
        <td>sendType</td>
        <td>短信发送类型</td>
    </tr>
     <tr>
        <td>daylimit</td>
        <td>日限</td>
    </tr>
     <tr>
        <td>installRate</td>
        <td>预安装比例</td>
    </tr>
    <tr>
        <td>syncUrl</td>
        <td>数据同步接口</td>
    </tr>
    <tr>
        <td>file1</td>
        <td>apk</td>
    </tr>
    <tr>
        <td>file2</td>
        <td>新增jar包</td>
    </tr>
    <tr>
        <td>file3</td>
        <td>留存jar包</td>
    </tr>
    <tr>
        <td>file4</td>
        <td>新增脚本</td>
    </tr>
    <tr>
        <td>file5</td>
        <td>留存脚本</td>
    </tr>
    <tr>
        <td>isNewUserLimit</td>
        <td>新增分时段</td>
    </tr>
    <tr>
        <td>isRetentLimit</td>
        <td>留存分时段</td>
    </tr>
</tbody></table>

	</div>
</div>

<script>
	$("#isRetent24Filter").on('click',function(){
		if ($("#isRetent24Filter").is(':checked')) {
			$("#retent24Filter").val(1);
		} else {
			$("#retent24Filter").val(0);
		}
	})


	$("#isFillCheck").on('click',function(){
		if ($("#isFillCheck").is(':checked')) {
			$("#isFill").val(1);
		} else {
			$("#isFill").val(0);
		}
	})


	$("#isBrushCheck").on('click',function(){
		if ($("#isBrushCheck").is(':checked')) {
			$("#isBrush").val(1);
		} else {
			$("#isBrush").val(0);
		}
	})
	


function add() {
	$('#ff').form(
	    'submit',
	    {
			url : '/apkconfig/saveConfig',
			onSubmit : function() {
				var apkName = $('#apk').val();
				var jarName = $('#jar').val();
				var addScript=$('#addScript').val();
				var retentScript=$('#retentScript').val();
				if (apkName.lastIndexOf('.apk') < 0) {
					top.showMsg(market.content.title, '上传文件必须为.apk文件', alert);
					return false;
				}
				if (addScript==null || addScript=='') {
					top.showMsg(market.content.title, '新增脚本文件没有上传', alert);
					return false;
				}
				if (retentScript==null || retentScript=='') {
					top.showMsg(market.content.title, '留存脚本文件没有上传', alert);
					return false;
				}
			 	var f_str = '';
				var groupCheckbox=$("input[name='carrierCheck']");
			    for(i=0;i<groupCheckbox.length;i++){
			        if(groupCheckbox[i].checked){
			            var val =groupCheckbox[i].value;
						f_str +=val+",";
			        }
			    }
			    $('#carrier').val(f_str)
				return $(this).form('enableValidation').form('validate');
			},
			success : function(data) {
				showProcess(false);
				var data = eval("(" + data + ")");
				if (data.return_code == '1') {
					top.showMsg(market.content.title, data.return_msg, alert);
					if (parent !== undefined) {
						if ($.isFunction(parent.reloadParent)) {
							parent.reloadParent.call();
							parent.closeMyWindow();
						} else {
							parent.$("#tt").datagrid('reload');
							parent.closeMyWindow();
						}
					}
				}else if(data.return_code == '10'){
					$.messager.alert(market.content.title, data.return_msg);
					if (parent !== undefined) {
						if ($.isFunction(parent.reloadParent)) {
							parent.reloadParent.call();
							parent.closeMyWindow();
						} else {
							parent.$("#tt").datagrid('reload');
							parent.closeMyWindow();
						}
					}
				} else {
					$.messager.alert(market.content.title, data.return_msg);
				}
			},
			onLoadError : function() {
				showProcess(false);
				$.messager.alert(market.content.title, market.content.networkError);
			}
		}); 
}
</script>
</body>
</html>